package com.site.dto.backend.system;

import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;

import com.site.util.base.businessbean.BaseBusinessBean;

/**
 * 资源
 * @author lee 2012-10-12 
 *
 */

public class ResourseBizBean extends BaseBusinessBean {
	
	private static final long serialVersionUID = 1L;
	

	private Long id;
	/*
	 * 资源名称
	 */
	private String name;
	/*
	 * 菜单标题
	 */
	private String title;
	/*
	 * 菜单访问地址
	 */
	private String url;
	/*
	 * 排序
	 */
	private Integer orderBy;
	/*
	 * 资源子集合
	 */
	private List<ResourseBizBean> childrenList = new ArrayList<ResourseBizBean>();
	/*
	 * 资源父
	 */
	private ResourseBizBean parentResourseBizBean;
	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		try {
			this.name = java.net.URLDecoder.decode(name,"UTF-8");
		} catch (UnsupportedEncodingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		try {
			this.title = java.net.URLDecoder.decode(title,"UTF-8");
		} catch (UnsupportedEncodingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		try {
			this.url = java.net.URLDecoder.decode(url,"UTF-8");
		} catch (UnsupportedEncodingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	public Integer getOrderBy() {
		return orderBy;
	}

	public void setOrderBy(Integer orderBy) {
		this.orderBy = orderBy;
	}

	public List<ResourseBizBean> getChildrenList() {
		return childrenList;
	}

	public void setChildrenList(List<ResourseBizBean> childrenList) {
		this.childrenList = childrenList;
	}

	public ResourseBizBean getParentResourseBizBean() {
		return parentResourseBizBean;
	}
	public void setParentResourseBizBean(ResourseBizBean parentResourseBizBean) {
		this.parentResourseBizBean = parentResourseBizBean;
	}

	@Override
	public boolean equals(Object obj) {
		ResourseBizBean obj1 = (ResourseBizBean)obj;
		if(obj1.getId().equals(this.getId())){
			return true;
		}
		return false;
	}
}
